
"""
@author: xiangping
@contact: xiangpingbu@gmail.com
@time: 2020/1/3 2:22 下午
@file: logging_config.py
@Desc:
"""

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "formatters": {
        "simple": {
            'format': '%(asctime)s [%(name)s:%(lineno)d] [%(levelname)s]- %(message)s'
        },
        'standard': {
            'format': '%(asctime)s %(levelname)s %(process)d %(thread)d %(pathname)s %(lineno)s %(message)s'
        },
    },

    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "level": "DEBUG",
            "formatter": "standard",
            "stream": "ext://sys.stdout"
        },
        'file': {
            'level': 'DEBUG',
            'class': 'logging.handlers.TimedRotatingFileHandler',
            'formatter': 'standard',
            'filename': '/var/log/ironman/ironman.log',
            'when': 'midnight',
            'interval': 1,
            'backupCount': 5,
            'encoding': 'utf-8'
        }
    },
    "root": {
        'handlers': ['file', 'console'],
        'level': "INFO",
        'propagate': True
    }
}